<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:stpoa="http://stpoa.com/facelets"
	template="/layout/template.xhtml">

	<ui:define name="head">
	</ui:define>

	<ui:include src="/layout/formulario_simples.xhtml"></ui:include>

	<ui:define name="body">

		<h1>Dados do Funcionário:</h1>

		<h:messages />

		<center>
			<table border="0" cellpadding="3px" cellspacing="0px" width=" 80% ">
				<tbody>
				<h:form id="formulario">
					<tr>
						<td class=" bodyCRUDBox ">
							<table style="padding: 5px 5px 0px;" border="0" width="100%">
								<tbody>
									<tr>
										<td>&nbsp;</td>
									</tr>
									<tr>
										<td>
																															
											<table border="0" cellpadding="2" cellspacing="1" width="100%">
											
												<!-- Titulo da sessão -->												
												<tr>
													<td colspan="4" class="separatorGrid3"
														style="border-width: 1px 0px 0px; padding: 5px 0px 10px;"
														valign="top" align="left">Sessão 1
													</td>
												</tr>
																								
												<tr>
													<td class="labelGrid" rowspan="1" nowrap="nowrap">Campo 1: &nbsp;</td>

													<td class="cellGrid" valign="middle" style="width: 50%"
														colspan="1" rowspan="1" nowrap="nowrap" align="left">
														<h:inputText  title="" styleClass="fieldGrid" style="width: 80px;"/>
														<input name="codEmpresa" value="" title="Código da Empresa"
														class="fieldGrid" style="width: 80px;" type="text"
														id="codEmpresa"/></td>

													<td class="labelGrid" rowspan="1" nowrap="nowrap">Data Inclusão: &nbsp;</td>

													<td class="cellGrid" valign="middle" style="width: 50%"
														colspan="1" rowspan="1" nowrap="nowrap" align="left">

														<table border="0" style="width: 100px;" cellpadding="0"
															cellspacing="0">
															<tr>
																<td nowrap="nowrap"><input type="text"
																	name="campoData" title="Data Inclusão" id=""
																	value="__/__/____" class="fieldGridData" maxlength="10"
																	OnKeyUp="mascaraData(this);"
																	onBlur="dataFormatNull(this);"/></td>
																	
																<td width="1" nowrap="nowrap" style="padding-left: 2px;">
																	<img src="imagens/calendario.gif" alt="" align="middle"
																	border="0" style="cursor: hand;"/>
																</td>
															</tr>
														</table>
													</td>
												</tr>

											</table>
											<div align="right">

												<div class="toolbarDiv">
													<table style="margin: 4px 0pt;" background="" border="0"
														cellpadding="0" cellspacing="5">
														<tbody>
															<tr bgcolor="">
																<td align="left" valign="middle" nowrap="nowrap">


																	<table
																		onclick="alertaRedireciona('Operação executada com sucesso.', 'listaEmpresas');"
																		style="cursor: hand;" border="0" cellpadding="0"
																		cellspacing="0" id="bttOk" name="bttOk">
																		<td style="width: 4px; height: 20px;"/>
																		<td style="color: white; font-size: 8pt; text-align: center; font-weight: bold; padding-left: 10px; padding-right: 10px;">Ok</td>
																		<td style="width: 4px; height: 20px;"/>
																	</table>


																</td>
																<td align="right" valign="middle" nowrap="nowrap">
																</td>
															</tr>
														</tbody>
													</table>
												</div>
											</div>
										</td>
									</tr>
								</tbody>
							</table>
						</td>
					</tr>
					</h:form>
				</tbody>
			</table>
		</center>

		<h:form>
			<h:panelGrid columns="2">

				<h:outputText value="Id:" />
				<h:inputText value="#{funcionario_bean.funcionario.id}" />

				<h:outputText value="Nome:" />
				<h:inputText value="#{funcionario_bean.funcionario.nome}" />

				<h:outputText value="Cargo:" />
				<h:inputText value="#{funcionario_bean.funcionario.cargo}" />

				<h:outputText value="Idade:" />
				<h:inputText value="#{funcionario_bean.funcionario.idade}" required="true" title="Idade" requiredMessage="Idade é obrigatória!"/>

				<h:outputText value="Cód. Empresa:" />
				<h:inputText value="#{funcionario_bean.empresa.id}" />
				
				
				<h:outputText value="Login:" />
				<h:inputText value="#{funcionario_bean.funcionario.login}" />
				
				<h:outputText value="Senha:" />
				<h:inputSecret value="#{funcionario_bean.funcionario.password}" />
				
				<h:outputText value="Ativo:" />
				<h:selectOneMenu value="#{funcionario_bean.funcionario.ativo}">
					<f:selectItem itemLabel="Sim" itemValue="true" />
					<f:selectItem itemLabel="Não" itemValue="false" />
				</h:selectOneMenu>

				<h:outputText value="É Administrador ?" />
				<h:selectOneMenu value="#{funcionario_bean.funcionario.admin}">
					<f:selectItem itemLabel="Sim" itemValue="true" />
					<f:selectItem itemLabel="Não" itemValue="false" />
				</h:selectOneMenu>
			</h:panelGrid>

			<h:commandButton value="Salvar" action="#{funcionario_bean.salvar}" />
			<h:commandButton value="Remover" action="#{funcionario_bean.remover}" />
			<h:commandButton value="Voltar" action="#{funcionario_bean.voltar}" />
		</h:form>


	</ui:define>
</ui:composition>